#pragma once

#include "AbstractRender.h"
#include "BasicCamera.h"
#include "Shape.h"
#include "ShapeLibrary.h"
#include "Texture.h"
#include "TextureLibrary.h"
#include "ShaderPairLibrary.h"
#include "ModelLibrary.h"

#include "SceneNode.h"

#include "Model.h"
#include "List.h"

#include "BipedalMecha.h"

// describes the constant buffer that will be used to draw the cube


ref class SceneGraphRender : public AbstractRender
{
internal :
    SceneGraphRender();

    virtual void CreateDeviceIndependentResources() override;
    virtual void CreateDeviceResources() override;
    virtual void CreateWindowSizeDependentResources() override;
    virtual void Render() override;
    virtual void Update(float timeTotal, float timeDelta) override;
	virtual void CleanUpResources() override;

private:
  
    ID3D11SamplerState*          m_sampler;                    // cube texture sampler
    ID3D11Buffer*                m_constantBuffer;             // constant buffer resource

    ModelViewProjectionConstantBuffer           m_modelViewProjection;          // constant buffer resource data
    BasicCamera*             m_camera;                      // scene camera

	float4x4 modelTransform;

	// our libraries of reuseable shapes, textures, shaders and models.
	ShapeLibrary *shapes;
	TextureLibrary* textures;
	ShaderPairLibrary* shaderPairs;

	ModelLibrary* models;

	// our scenegraph
	SceneNode* sceneGraph;
	List* listOfRenderables;

	// our mecha
	BipedalMecha* mecha;

};